﻿@using KRM.Core
@{
    ViewBag.Title = "Moderate Reviews";
    Layout = "~/Views/Shared/_Layout.cshtml";
    tblUser user = ViewBag.User;
    var enable = user.HasPermission(Permissions.CanViewModerateReviews);
}
<script src="~/js/product.js"></script>
<script>
    $(document).ready(function () {
        $("#fr-moderatereviewfilter").submit();
        var height = $(window).height() - 255;
        $(".reviewscontent table").attr("data-height", height);
    })
</script>
<div class="container-fluid">
    <div class="row-fluid">
        <fieldset>
            <legend>Filter Displayed Reviews</legend>
            <form class="margin0" method="POST" action="/products/moderatereviewfilter" id="fr-moderatereviewfilter">
                <div class="row-fluid">
                    <div class="span2">
                        Store
                    @Html.DropDownList("StoreID", null, new { @class = "input-block-level", onchange = "reviewstorechange(this.value)" })
                    </div>
                    <div class="span2">
                        Product
                    @Html.DropDownList("ProductID", null, new { @class = "input-block-level" })
                    </div>
                    <div class="span2">
                        No of Result
                    <select class="input-block-level" name="noofresult">
                        <option value="0">No Limit</option>
                        <option selected="selected" value="200">200</option>
                    </select>
                    </div>
                    <div class="span2">
                        Moderation Status
                    @Html.DropDownList("StatusID", null, new { @class = "input-block-level" })
                    </div>
                    <div class="span2">
                        Moderated By
                    @Html.DropDownList("UserID", null, new { @class = "input-block-level" })
                    </div>
                    <div class="span2">
                        <input type="submit" class="btn btn-primary" style="width: 100%; margin-top: 20px" value="Filter" />
                    </div>
                </div>
            </form>
        </fieldset>
        <div class="reviewscontent">
            <table class="table table-bordered table-fix krmtable" data-height="300">
                <thead>
                    <tr>
                        <th>StoreName</th>
                        <th>ProductName</th>
                        <th>ReviewerName</th>
                        <th>Review</th>
                        <th>Rating</th>
                        <th>DatePlace</th>
                    </tr>
                </thead>
            </table>
        </div>
        <div class="text-right" style="margin-top: 20px">
            <input type="button" class="btn btn-success btn-addnewreview" onclick="PopupCenter('/products/review',900,650)" value="Add New Review" @(enable ? "" : "disabled=disabled") />
            <input type="button" class="btn btn-primary btn-editreview" style="margin: 0 7px" value="View/Edit Review" onclick="alert('Please select review!')" />
            <input type="button" class="btn btn-danger btn-markasspam" value="Mark as Spam" onclick="alert('Please select review!')" />
            @if (enable)
            {
                <input type="button" class="btn btn-approveanddisplay" style="margin-left: 7px" value="Approve and Display" onclick="alert('Please select review!')" />
                <input type="button" class="btn btn-approve" style="margin: 0 7px" value="Approve (Don't Display)" onclick="alert('Please select review!')" />
                <input type="button" class="btn btn-markasunsuitable" value="Mark as Unsuitable" onclick="alert('Please select review!')" />
            }
        </div>
    </div>
</div>

